package com.billdowney.entity.auth;

import javax.persistence.CascadeType;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

import com.billdowney.entity.base.BaseEntityIdByUUIDHex;

import io.swagger.annotations.ApiModelProperty;

/**
 * 角色组关系
 * 
 * @author 超级小富翁 - BillDowney
 * @date 2019年2月28日 上午11:19:09
 */
@Entity
@Table(name = "auth_role_rel_group")
public class AuthRoleRelGroup extends BaseEntityIdByUUIDHex {

	private static final long serialVersionUID = 1234760183599748876L;

	@ManyToOne(targetEntity = AuthRole.class, cascade = CascadeType.ALL, fetch = FetchType.LAZY)
	@JoinColumn(name = "authRole_id")
	@ApiModelProperty(value = "角色信息")
	private AuthRole authRole;

	@ManyToOne(targetEntity = AuthRoleGroup.class, cascade = CascadeType.ALL, fetch = FetchType.LAZY)
	@JoinColumn(name = "authRoleGroup_id")
	@ApiModelProperty(value = "角色组信息")
	private AuthRoleGroup authRoleGroup;

	public AuthRole getAuthRole() {
		return authRole;
	}

	public void setAuthRole(AuthRole authRole) {
		this.authRole = authRole;
	}

	public AuthRoleGroup getAuthRoleGroup() {
		return authRoleGroup;
	}

	public void setAuthRoleGroup(AuthRoleGroup authRoleGroup) {
		this.authRoleGroup = authRoleGroup;
	}

	@Override
	public String toString() {
		return "AuthRoleRelGroup [authRole=" + authRole + ", authRoleGroup=" + authRoleGroup + "]";
	}

}
